import {RouteRecordRaw} from 'vue-router'

const Layout = () => import('@/view/home/index.vue')
const Login = () => import('@/view/login.vue')
const xxx = () => import('@/view/404/index.vue')
const xterm = () => import('@/view/xterm/index.vue')
const qiankun = () => import('@/view/qiankun/index.vue')
//测试页面
const test1 = () => import('@/view/testPage/test1.vue')
const test2 = () => import('@/view/testPage/test2.vue')
const test3 = () => import('@/view/testPage/test3.vue')
const test4 = () => import('@/view/testPage/test4.vue')
const test5 = () => import('@/view/testPage/test5.vue')
const createRouters: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: 'login'
    },
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    {
        path: '/home',
        component: Layout,
        redirect: '/home/David',
        children:[
            {
                path:'David',
                name:'David',
                component: test1
            },
            {
                path:'Deborah',
                name:'Deborah',
                component: test2
            },
            {
                path:'Sandra',
                name:'Sandra',
                component: test3
            },
            {
                path:'Maria',
                name:'Maria',
                component: test4
            },
            {
                path:'George',
                name:'George',
                component: test5
            },
        ]
    },
    {
        path: '/404',
        component: xxx
    },
    {
        path: '/xterm',
        component: xterm
    },
    {
        path: '/qinaKun',
        component: qiankun
    },
    // {
    //     path: "/:catchAll(.*)", // 不识别的path自动匹配404
    //     redirect: '/404'
    // }

]
export default createRouters;